package com.example.dbsample.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

// 落地网关
@TableName("gateway_outbound")
public class OutboundGateway extends GatewayInfo {
    private String fsServerIp;  // 举例，服务器的任一机器ip或none
    private String fsServerName;    // 举例：none
    private Integer type;           // 举例：0
    private String username = "";   // 用户名，鉴权用，可为空
    private String password = "";   // 密码，鉴权用，可为空
    private String host;            // vos或供应商ip，举例：xxx.xxx.xxx.xxx:5060
    private String remark;          // 备注，可为空

    public OutboundGateway() {
    }

    public OutboundGateway(Long id, int priority, int concurrent) {
        super(id);
        this.setPriority(priority);
        this.setConcurrency(concurrent);
    }

    public String getFsServerIp() {
        return this.fsServerIp;
    }

    public void setFsServerIp(String fsServerIp) {
        this.fsServerIp = fsServerIp;
    }

    public String getFsServerName() {
        return this.fsServerName;
    }

    public void setFsServerName(String fsServerName) {
        this.fsServerName = fsServerName;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getType() {
        return this.type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String userName) {
        this.username = userName;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getHost() {
        return this.host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (o != null && this.getClass() == o.getClass()) {
            OutboundGateway that = (OutboundGateway)o;
            return Objects.equals(this.name, that.name);
        } else {
            return false;
        }
    }

    public int hashCode() {
        return Objects.hash(new Object[]{this.name});
    }

    public List<String> getFsServerIps() {
        return new ArrayList<>();
    }
}
